package com.qianli.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.qianli.dao.UserDao;
import com.qianli.pojo.Group;
import com.qianli.pojo.User;
@Transactional
public class UserService{
	private UserDao userDao;
	public User login(User user){
		User u=userDao.findByUnique("username", user.getUsername());
		if(u!=null&&u.getPassword().equals(user.getPassword())){
			return u;
		}else{
			return null;
		}
		
	}
	
	public List<User> findBy(String id){
		return userDao.findBy("id", id);
		
	}
	public List<User> findAll() {
		
		return userDao.findAll();
	}
	
	
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	

}
